//
//  PopupController.m
//  ZBLib
//
//  Created by  on 11-12-8.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import "PopupController.h"
#import "ZBQuestionPopview.h"

@implementation PopupController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{
}
*/

-(void)alertMessageBox {
    ZBQuestionPopview *popView = [[ZBQuestionPopview alloc] initWithTitle:@"Title" message:@"This is message in popup view" delegate:nil button:@"取消" otherButton:@"确定"];
    [popView show];
}


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];
    UIButton *button =[UIButton buttonWithType:UIButtonTypeRoundedRect];
    button.frame = CGRectMake(100, 50, 100, 40);
    [button setTitle:@"Alert" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(alertMessageBox) forControlEvents:UIControlEventTouchUpInside];
}


- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
